package com.example.wangzh.developkit.control.hover;

import android.content.Context;
import androidx.annotation.NonNull;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.TextView;

import com.example.wangzh.developkit.R;

import io.mattcarroll.hover.Navigator;
import io.mattcarroll.hover.NavigatorContent;

/**
 * Created by zhwang16 on 2018/8/30.
 */

public class MyNavigationContent extends FrameLayout implements NavigatorContent {
    private ImageView imageViewLogo;
    private TextView textViewTitle;
    private int imageResId;
    private String title;

    public MyNavigationContent(@NonNull Context context, int imageRedId, String title) {
        super(context);
        this.imageResId = imageRedId;
        this.title = title;
        init();
    }

    private void init() {
        LayoutInflater.from(getContext()).inflate(R.layout.view_content_text_icon, this, true);
        imageViewLogo = (ImageView) findViewById(R.id.iv_logo);
        textViewTitle = (TextView) findViewById(R.id.tv_title);
        imageViewLogo.setImageResource(imageResId);
        textViewTitle.setText(title);
    }

    @NonNull
    @Override
    public View getView() {
        return this;
    }

    @Override
    public void onShown(@NonNull Navigator navigator) {
    }

    @Override
    public void onHidden() {
    }
}